<!DOCTYPE html>
<html>

<head lang="en">
    <meta charset="UTF-8">
    <title>子页面</title>
</head>

<body>
    <script type="text/javascript">
        var ifr = window.parent;
        var targetOrigin = 'http://localhost:4000';
        ifr.postMessage('b页面数据', targetOrigin);
    </script>
</body>

</html>